Optimal. Leaf size=103 \[ \frac {4 \tan ^3(c+d x)}{3 a d}+\frac {4 \tan (c+d x)}{a d}-\frac {3 \tanh ^{-1}(\sin (c+d x))}{2 a d}-\frac {3 \tan (c+d x) \sec (c+d x)}{2 a d}-\frac {\tan (c+d x) \sec ^2(c+d x)}{d (a \cos (c+d x)+a)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.10, antiderivative size = 103, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {2768, 2748, 3767, 3768, 3770} \[ \frac {4 \tan ^3(c+d x)}{3 a d}+\frac {4 \tan (c+d x)}{a d}-\frac {3 \tanh ^{-1}(\sin (c+d x))}{2 a d}-\frac {3 \tan (c+d x) \sec (c+d x)}{2 a d}-\frac {\tan (c+d x) \sec ^2(c+d x)}{d (a \cos (c+d x)+a)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2748
Rule 2768
Rule 3767
Rule 3768
Rule 3770
Rubi steps
\begin {align*} \int \frac {\sec ^4(c+d x)}{a+a \cos (c+d x)} \, dx &=-\frac {\sec ^2(c+d x) \tan (c+d x)}{d (a+a \cos (c+d x))}-\frac {\int (-4 a+3 a \cos (c+d x)) \sec ^4(c+d x) \, dx}{a^2}\\ &=-\frac {\sec ^2(c+d x) \tan (c+d x)}{d (a+a \cos (c+d x))}-\frac {3 \int \sec ^3(c+d x) \, dx}{a}+\frac {4 \int \sec ^4(c+d x) \, dx}{a}\\ &=-\frac {3 \sec (c+d x) \tan (c+d x)}{2 a d}-\frac {\sec ^2(c+d x) \tan (c+d x)}{d (a+a \cos (c+d x))}-\frac {3 \int \sec (c+d x) \, dx}{2 a}-\frac {4 \operatorname {Subst}\left (\int \left (1+x^2\right ) \, dx,x,-\tan (c+d x)\right )}{a d}\\ &=-\frac {3 \tanh ^{-1}(\sin (c+d x))}{2 a d}+\frac {4 \tan (c+d x)}{a d}-\frac {3 \sec (c+d x) \tan (c+d x)}{2 a d}-\frac {\sec ^2(c+d x) \tan (c+d x)}{d (a+a \cos (c+d x))}+\frac {4 \tan ^3(c+d x)}{3 a d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 4.27, size = 368, normalized size = 3.57 \[ \frac {\cos \left (\frac {1}{2} (c+d x)\right ) \left (6 \sec \left (\frac {c}{2}\right ) \sin \left (\frac {d x}{2}\right )+\frac {1}{8} \sec (c) \cos \left (\frac {1}{2} (c+d x)\right ) \sec ^3(c+d x) \left (-12 \sin (2 c+d x)-6 \sin (c+2 d x)-6 \sin (3 c+2 d x)+20 \sin (2 c+3 d x)+9 \cos (2 c+3 d x) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+9 \cos (4 c+3 d x) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+27 \cos (d x) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )\right )+27 \cos (2 c+d x) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )\right )-9 \cos (2 c+3 d x) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )-9 \cos (4 c+3 d x) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )+48 \sin (d x)\right )\right )}{3 a d (\cos (c+d x)+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.05, size = 124, normalized size = 1.20 \[ -\frac {9 \, {\left (\cos \left (d x + c\right )^{4} + \cos \left (d x + c\right )^{3}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - 9 \, {\left (\cos \left (d x + c\right )^{4} + \cos \left (d x + c\right )^{3}\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (16 \, \cos \left (d x + c\right )^{3} + 7 \, \cos \left (d x + c\right )^{2} - \cos \left (d x + c\right ) + 2\right )} \sin \left (d x + c\right )}{12 \, {\left (a d \cos \left (d x + c\right )^{4} + a d \cos \left (d x + c\right )^{3}\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.50, size = 114, normalized size = 1.11 \[ -\frac {\frac {9 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{a} - \frac {9 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{a} - \frac {6 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a} + \frac {2 \, {\left (15 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 16 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 9 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{3} a}}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.12, size = 183, normalized size = 1.78 \[ \frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}-\frac {1}{3 a d \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}-\frac {1}{a d \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {5}{2 a d \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 a d}-\frac {1}{3 a d \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}+\frac {1}{a d \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}-\frac {5}{2 a d \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}-\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 a d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.82, size = 205, normalized size = 1.99 \[ \frac {\frac {2 \, {\left (\frac {9 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {16 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {15 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}}\right )}}{a - \frac {3 \, a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {3 \, a \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} - \frac {a \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}}} - \frac {9 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{a} + \frac {9 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{a} + \frac {6 \, \sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.57, size = 96, normalized size = 0.93 \[ \frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a\,d}-\frac {3\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a\,d}-\frac {5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5-\frac {16\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{3}+3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a\,d\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )}^3} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \frac {\int \frac {\sec ^{4}{\left (c + d x \right )}}{\cos {\left (c + d x \right )} + 1}\, dx}{a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________